//
//  UIButton+LX.m
//  微博
//
//  Created by imera on 15/9/17.
//  Copyright (c) 2015年 imera. All rights reserved.
//

#import "UIButton+LX.h"

@implementation UIButton (LX)

+ (UIBarButtonItem *)initWithIcon:(NSString *)icon highIcon:(NSString *)highIcon target:(id)target action:(SEL)action
{
    //右边按钮
    UIButton *Btn = [[UIButton alloc]init];
    
    [Btn setImage:[UIImage imageWithName:icon] forState:UIControlStateNormal];
    [Btn setImage:[UIImage imageWithName:highIcon] forState:UIControlStateHighlighted];
    
    Btn.bounds = CGRectMake(0, 0, Btn.currentImage.size.width, Btn.currentImage.size.height);
    
    [Btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[UIBarButtonItem alloc]initWithCustomView:Btn];
}

@end
